home *** CD-ROM | disk | FTP | other *** search
- Attribute VB_Name = "genModule"
- ' as you can see i'm still working on it it may some bugs
- ' but some of the functions and subs work great
- ' hope you enjoy and make it usefull
- 'for any comments you can e-mail me at uzib@kkl.org.il
-
-
-
-
-
-
-
- Global Const LISTVIEW_BUTTON = 11
- Public Const HKEY_CLASSES_ROOT = &H80000000
-
- Declare Function GetModuleHandle Lib _
- "kernel32" Alias "GetModuleHandleA" _
- (ByVal lpModuleName As String) As Long
-
- Declare Function ExtractIcon Lib "shell32.dll" Alias _
- "ExtractIconA" (ByVal hInst As Long, ByVal _
- lpszExeFileName As String, ByVal nIconIndex As Long) As Long
- Declare Function DrawIcon Lib "user32" _
- (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal hIcon As Long) As Long
- Declare Function LoadIcon Lib "user32" Alias _
- "LoadIconA" (ByVal hInstance As Long, ByVal lpIconName As String) As Long
- Declare Function GetDriveType Lib "kernel32" _
- Alias "GetDriveTypeA" (ByVal nDrive As String) As Long
- Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey _
- As Long) As Long
- Declare Function RegQueryValue Lib "advapi32.dll" Alias _
- "RegQueryValueA" (ByVal hKey As Long, ByVal lpSubKey As _
- String, ByVal lpValue As String, lpcbValue As Long) As Long
-
-
-
- Public fMainForm As frmMain
-
-
- Sub Main()
- Set fMainForm = New frmMain
- fMainForm.Show
- End Sub
-
-
-
- Public Function qryReg(fileend As String)
- Dim a, subkey, valname, position, bufstr As String
- Dim valsize, value, newvalsize, iconvalue As Long
-
- subkey = fileend
- bufstr = Space(50)
- valsize = 45
- newvalsize = 145
- value = RegQueryValue(HKEY_CLASSES_ROOT, subkey, _
- bufstr, valsize)
- a = bufstr
- frmMain.txtValue.text = a
- frmMain.txtValue.text = bufstr
- position = Trim(frmMain.txtValue.text) + "\DefaultIcon"
- bufstr = Space(150)
- iconvalue = RegQueryValue(HKEY_CLASSES_ROOT, position, _
- bufstr, newvalsize)
- RegCloseKey (HKEY_CLASSES_ROOT)
- qryReg = bufstr
- End Function
-
-
- Public Function GetExplorer()
- Dim a, subkey, valname, position, bufstr As String
- Dim valsize, value, newvalsize, iconvalue As Long
- Screen.MousePointer = 11
- subkey = "InternetExplorer.Application\CLSID"
- bufstr = Space(50)
- valsize = 45
- newvalsize = 145
- value = RegQueryValue(HKEY_CLASSES_ROOT, subkey, _
- bufstr, valsize)
- a = bufstr
- frmMain.txtValue.text = a
- frmMain.txtValue.text = bufstr
- position = "CLSID\" + Trim(frmMain.txtValue.text) + "\LocalServer32"
- bufstr = Space(150)
- iconvalue = RegQueryValue(HKEY_CLASSES_ROOT, position, _
- bufstr, newvalsize)
- RegCloseKey (HKEY_CLASSES_ROOT)
- frmMain.txtValue.text = ""
- Screen.MousePointer = 1
- GetExplorer = bufstr
- ''temp = Shell(bufstr, vbMaximizedFocus)
- End Function
-
- Public Function exereg(fileend As String)
- Dim a, subkey, valname, position, bufstr As String
- Dim valsize, value, newvalsize, iconvalue As Long
-
- subkey = fileend
- bufstr = Space(50)
- valsize = 45
- newvalsize = 145
- value = RegQueryValue(HKEY_CLASSES_ROOT, subkey, _
- bufstr, valsize)
- a = bufstr
- frmMain.txtValue.text = a
- frmMain.txtValue.text = bufstr
- position = Trim(frmMain.txtValue.text) + "\shell\open\command"
- bufstr = Space(150)
- iconvalue = RegQueryValue(HKEY_CLASSES_ROOT, position, _
- bufstr, newvalsize)
- RegCloseKey (HKEY_CLASSES_ROOT)
- exereg = bufstr
- End Function
-
- Public Sub open_file(file_to_open As String)
- Dim temp
- Dim result As String
- Select Case Right(file_to_open, 3)
- Case "EXE"
- temp = Shell(file_to_open, vbNormalFocus)
- Case Else
- result = exereg(Right(file_to_open, 4))
- ''uzi = Trim(result)
- ''uzi = Right(uzi, 4)
- ''frmMain.txtValue.Text = uzi
- ''a = frmMain.txtValue.Text
- i = InStr(1, Trim(result), "%", vbTextCompare)
- If i = 0 Then
- i = InStr(1, Trim(result), "/", vbTextCompare)
- End If
- If i > 0 Then
- uzi = Left(Trim(result), i - 1)
- ''uzi = """" + uzi + """"
- uzi = "" + uzi + ""
- file_to_open = "" + file_to_open + ""
- temp = Shell(uzi + file_to_open, vbMaximizedFocus)
- Else
- temp = Shell("C:\WINDOWS\rundll32.exe shell32.dll,OpenAs_RunDLL " + file_to_open, vbNormalFocus)
- End If
- End Select
- End Sub
-
- Sub ShowFileInfo(filespec, filepic)
- Dim fs, f, s, datec
- On Error Resume Next
- Set fs = CreateObject("Scripting.FileSystemObject")
- Set f = fs.GetFile(filespec)
- frmFileProp.Show
- frmFileProp.chkArchive.value = 0
- frmFileProp.chkReadOnly.value = 0
- frmFileProp.chkHidden.value = 0
- frmFileProp.chkSystem.value = 0
- frmFileProp.lblFPath.Caption = f.path
- frmFileProp.pctPropf.Picture = filepic
- frmFileProp.lblSize1.Caption = f.Size
- frmFileProp.lblName1.Caption = f.Name
- frmFileProp.lblType1.Caption = f.Type
- frmFileProp.lbldCreate1.Caption = f.datecreated
- frmFileProp.lblLastacc1.Caption = f.datelastaccessed
- frmFileProp.lblLastmod1.Caption = f.datelastmodified
- If f.Attributes And 32 Then frmFileProp.chkArchive.value = 1
- If f.Attributes And 1 Then frmFileProp.chkReadOnly.value = 1
- If f.Attributes And 2 Then frmFileProp.chkHidden.value = 1
- If f.Attributes And 4 Then frmFileProp.chkSystem.value = 1
- 'eh:
- 'Resume
- End Sub
-
-
-
- Public Sub showSearch(key, text, image)
- frmSearch.Show
- frmSearch.cmbiSlookIn.ImageList = frmMain.ImageList3
- frmSearch.cmbiSlookIn.ComboItems.Add , key, Mid(text, 21, Len(text)), image
- End Sub
-
-
-
- Public Function renameFile(oldName, newName) As Integer
- Dim fs, f, s
- Set fs = CreateObject("Scripting.FileSystemObject")
- Set f = fs.GetFile(oldName)
- If f.Attributes And 2 Then
- renameFile = 1
- Else
- f.Name = newName
- renameFile = 0
- End If
- End Function
-